#!/bin/bash
doCheck (){
   rs=$?
   if [ $rs -ne 0 ]
   then
        echo "\033[41;37m $1 \033[0m"
        exit
   fi
}

host=120.27.159.95
user=root
rm -rf ./target
cd ../../
sh install.sh
doCheck "打包失败，请检查代码！" 
cd -
echo "\033[41;37m 打包完成，即将开始上传war包并部署... \033[0m"
echo "\033[41;37m 请输入服务器密码: \033[0m"
scp ../target/laozihao-web-0.0.1-SNAPSHOT.war ${user}@${host}:/root/
doCheck "上传失败！"
echo "\033[41;37m 上传War包完成 \033[0m"
